package com.sh.mytool.cv.domain;

import javax.persistence.*;
import javax.persistence.Column;
import com.sh.mytool.cv.domain.Video;
import static javax.persistence.CascadeType.PERSIST;
import static javax.persistence.CascadeType.REMOVE;
import static javax.persistence.CascadeType.REFRESH;
import static javax.persistence.CascadeType.MERGE;
import static javax.persistence.FetchType.LAZY;
import static javax.persistence.GenerationType.AUTO;

@Entity
@Table(name = "tb_VIDEOFILE")
public class VideoFile {

	@Column(length = 255)
	private String name;
	@Column(length = 500)
	private String path;
	@OneToOne(cascade = { PERSIST, REFRESH, MERGE }, fetch = LAZY, optional = true)
	@JoinColumn(name = "video_id", referencedColumnName = "id")
	private Video video;
	@Id
	@GeneratedValue(strategy = AUTO)
	private Long id;

	public void setName(String param) {
		this.name = param;
	}

	public String getName() {
		return name;
	}

	public void setPath(String param) {
		this.path = param;
	}

	public String getPath() {
		return path;
	}

	public Video getVideo() {
		return video;
	}

	public void setVideo(Video param) {
		this.video = param;
	}

	public void setId(Long param) {
		this.id = param;
	}

	public Long getId() {
		return id;
	}

}